﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// Gets BrowsableAttribute 
    /// </summary>
    public class HiddenByPropertyValueTypeAttribute : DynamicTypeDependentAttribute
    {
        /// <summary>
        /// Creates HiddenByPropertyValueTypeAttribute instance
        /// </summary>
        /// <param name="property">Property name</param>
        /// <param name="types">Types for which BrowsableAttribute(false) will be returned</param>
        public HiddenByPropertyValueTypeAttribute(string property, params Type[] types)
            : base(property, types)
        {
        }
        /// <summary>
        /// Returns new BrowsableAttribute(!valuesMatch)
        /// </summary>
        /// <param name="valuesMatch"></param>
        /// <returns></returns>
        protected override Attribute GetAttribute(bool valuesMatch)
        {
            return new System.ComponentModel.BrowsableAttribute(!valuesMatch);
        }
    }
}
